<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>

        <script src="scripts/gears_init.js"></script>
        <script src="scripts/Math.uuid.js"></script>

        <script type='text/javascript'>
            if( window.addEventListener )
            {
                window.addEventListener ( 'unload',  // to disable in-memory caching
                function( e ) {}, // do nothing
                /*capture phase*/false );
            }
        </script>

        <script type='text/javascript'>
            function startApplet() {
                document.id_com_biviz_jgooglegears_JGGStubApplet.start();
            }
            function stopApplet() {
                document.name_com_biviz_jgooglegears_JGGStubApplet.stop();
            }

            function getAppletUUID() {
                var cookie = document.cookie;
                var startPos = cookie.indexOf("APPLET_INST_UUID=", 0);
                var endPos = cookie.indexOf(";", startPos);
                var APPLET_INST_UUID_value = cookie.substr(startPos, endPos - startPos);
                return APPLET_INST_UUID_value;
            }

        </script>
    </head>
    <body>
        <h1>JSP Page</h1>

        <div id="display">display:</div>

        JGoogleGears Applet Stub <p/>


        <div onclick="startApplet()">Start Applet</div>
        <div onclick="stopApplet()">Stop Applet</div>
        <applet code="com.biviz.jgooglegears.JGGStubApplet"
                id="id_com_biviz_jgooglegears_JGGStubApplet"
                name="name_com_biviz_jgooglegears_JGGStubApplet"
                archive="distApplets/com.biviz.jgooglegears.jar, applets/rhinohide.jar, applets/junit-4.5.jar"
                mayscript="true">
        </applet>


        <!--
        JGoogleGearsDriverApplet <p/>
        <applet code="com.biviz.jgooglegears.jdbc.JGoogleGearsDriverApplet"
            name="com_biviz_jgooglegears_jdbc_JGoogleGearsDriverApplet"
            archive="distApplets/com.biviz.jgooglegears.jar, applets/rhinohide.jar, applets/junit-4.5.jar"
            mayscript="true"
            >
        </applet>
        -->

        RunTestApplet <p/>
        <applet code="com.biviz.jgooglegears.jdbc.RunTestApplet"
                archive="distApplets/com.biviz.jgooglegears.jar, applets/rhinohide.jar, applets/junit-4.5.jar"
                mayscript="true"
        >
            <param name="APPLET_INST_UUID" value="&{getAppletUUID()}"/>
        </applet>



    </body>
</html>
